package it.xiuxian.dagongyuzhou

import android.webkit.WebChromeClient
import android.webkit.WebViewClient
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import it.xiuxian.dagongyuzhou.databinding.ActivityWebBinding
import it.xiuxian.dagongyuzhou.presenter.WebActivityPresenter
import it.xiuxian.lib.base.ArouterAddress
import it.xiuxian.lib.base.BaseActivity

@Route(path = ArouterAddress.WEBCTIVITY)
class WebActivity:BaseActivity<WebActivityPresenter>() {
    @JvmField
    @Autowired
    var url:String?=null
    override val layoutId: Int
        get() = R.layout.activity_web
    override val presenter: WebActivityPresenter
        get() = WebActivityPresenter()

    override fun initView() {
        //super.initView()
        ARouter.getInstance().inject(this)
       var binding= getViewDataBinding<ActivityWebBinding>()
        //            webView.setBackgroundColor(0);
//            webView.getBackground().setAlpha(0);
        binding.web.getSettings().setJavaScriptEnabled(true)
        binding.web.setWebChromeClient(WebChromeClient())
        binding.web.setWebViewClient(WebViewClient())
        binding.web.loadUrl(url!!)
        /*binding.tvTiao.setOnClickListener {
            ARouter.getInstance().build(ArouterAddress.SECONDACTIVITY).navigation()
        }
        binding.tvTiyan.setOnClickListener {
            ARouter.getInstance().build(ArouterAddress.LOGINACTIVITY).navigation()
        }*/
    }
}